import { validatenull } from '@/util/validate';

const getters = {
    tag: state => state.tags.tag,
    website: state => state.common.website,
    unionId: state => state.user.unionId,
    userInfo: state => state.user.userInfo,
    address: (state) => {
        const userInfo = state.user.userInfo;
        const address = `${userInfo.communityName}${userInfo.buildingName}${userInfo.unitName || ''}${userInfo.houseName}`;
        return address;
    },
    isWuye: (state) => {
        const roles = state.user.roles;
        return !(roles === state.common.website.rolesType.YZ || validatenull(roles));
    },
    isRoles: (state) => {
        const userType = state.user.userInfo.userType;
        return !(userType === state.common.website.rolesType.YZ || validatenull(userType));
    },
    localCode: state => state.common.localCode,
    user: state => state.user.user,
    community: state => state.user.community,
    theme: state => state.common.theme,
    isCollapse: state => state.common.isCollapse,
    isLock: state => state.common.isLock,
    isFullScren: state => state.common.isFullScren,
    lockPasswd: state => state.common.lockPasswd,
    tagList: state => state.tags.tagList,
    tagCurrent: state => state.tags.tagCurrent,
    tagWel: state => state.tags.tagWel,
    token: state => state.user.token,
    refershToken: state => state.user.refershToken,
    roles: state => state.user.roles,
    permission: state => state.user.permission,
    menu: state => state.user.menu,
    menuAll: state => state.user.menuAll,
    errLog: state => state.errLog.errLog,
    minHeight: state => state.common.minHeight,
};
export default getters
;